<?php
getHeader();
if (!isset($_POST['userName']))
{
	//这里最好写个js验证用户名长度之类的
	?>
<div id="content">
<div class="tabs headTabs">
<label><?php // deleted ?></label></div>
<div class="dataList">
<form action='?p=reg' method='post' name='regForm' id='regForm'
	class='inputbox'><label>用户名</label>
<input type="text" name="userName" class="regInput" />
<label>密码</label>
<input type="password" name="userPwd" class="regInput" />
<label>确认密码</label>
<input type="password" name="userRePwd" class="regInput" />
<label>Email</label>
<input type="text" name="userEmail" class="regInput" />
<label>邀请码</label>
<input type="text" name="inviteCode" class="regInput" />
<br />
<br />
<input type="submit" value="提交" class="button" /> </form>
</div>
</div>

	<?php
}
else
{
	?>
<div id="content">
<div class="tabs headTabs"><label>用户注册</label></div>
<div class="dataList"><label> <?php
switch (userReg($_POST['userName'],$_POST['userPwd'],$_POST['userRePwd'],$_POST['userEmail'],$_POST['inviteCode']))
{
	case 0:
		echo "注册成功.";
		break;
	case 1:
		echo "该用户名已被注册";
		break;
	case 2:
		echo "该用户名含有非法字符";
		break;
	case 3:
		echo "Email格式有误";
		break;
	case 4:
		echo "由于系统原因, 目前无法注册, 请联系管理员处理.";
		break;
	case 5:
		echo "两次输入的密码不相同.";
		break;
	case 6:
		echo "不存在该邀请码.";
		break;
	default:
		echo "";
}
?> <a href='?p=reg'>返回</a> </label></div>
</div>
<?php
}
//getPanel();
getFooter();
?>